Skip to content

Conversation

@InfiniteLee
Copy link
Contributor

I have run npm run test:machinima, and this patch passes all machinima tests: no

add property maxGrabBehavior to specify the behavior to follow when maxGrabbers is reached.

Default is what it does now, which is nothing. Also added 'drop' which ends the grab with the the first hand currently grabbing so that the new hand can grab.

…axGrabbers is reached.

Default is what it does now, which is nothing. Also added 'drop' which ends the grab with the the first hand currently grabbing so that the new hand can grab.
@InfiniteLee InfiniteLee changed the title Feature/max grab behavior max grab behavior attribute Jul 19, 2018
@InfiniteLee InfiniteLee mentioned this pull request Jul 19, 2018
@wmurphyrd
Copy link
Member

This runs up against the same API gap as #124 - the need to alter the super-hands state. I've filed #152 to track this.


if (Number.isFinite(this.data.maxGrabbers) && !grabAvailable &&
this.grabbed && this.data.maxGrabBehavior === 'drop') {
this.grabbers[0].components['super-hands'].onGrabEndButton()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would crash the component if it has button filtering enabled with a TypeError from trying to access properties on a null event detail.
https://github.com/wmurphyrd/aframe-super-hands-component/blob/master/reaction_components/prototypes/buttons-proto.js#L5

@wmurphyrd
Copy link
Member

What's the different behavior that you're achieving here? The current default settings are designed to enable a smooth hand-to-hand pass. When a second hand starts grabbing, the original hand remains in control until that button is released, then then second hand takes over the grab. For example, watch this machinima test

@InfiniteLee
Copy link
Contributor Author

The desired behavior is to have the current hand holding the object immediately release it instead of requiring the initial hand to release first.
I have an experimental feature in hubs right now that lets an object's grab be a toggle- so that if you grab an object, it ignores the next release, but then drops the object on any future release (this maybe should be a feature moved into the super-hands stack, but it seemed easier to do that on the application side for now *see below). It is a bit awkward to have to grab/release a second time in the first hand to pass the object over.

So I see 3 options here:

  1. fixing this PR and allowing the option to define the behavior in the case of hitting maxGrabbers limit to either require release on the current hand first or not
  2. creating a new PR that allows a "toggleable" grab (which may require option 1. in some form, but maybe not depending on desired default behavior in that case)
  3. dropping this PR and hubs can do this purely application side
  • I also added an experimental concept that is more closely tied to how our input works, but allows us to specify a "primary" vs "secondary" action in regards to toggling a grab. The idea is that a primary action (e.g. grip button) will always cause the hand to drop on a second grab (in the case of a "toggleable" grab) but a secondary action (e.g. trigger) will only cause grab to start. This ties into the activatable reaction component such that you can, for example, grab a pen with a trigger or grip and be able to "activate" the pen with the trigger without dropping it, then drop it later with the grip.

@InfiniteLee
Copy link
Contributor Author

closing this as I've opted to use a custom reaction-component that copies grabbable's behavior but adds additional functionality (including this).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants